{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "dc2b7167-8e3b-4f55-95cf-866aaed90f16",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Gotchas\n",
    "# PyWavelets utilizes NumPy under the hood. That’s why handling the data containing None values can be surprising. None values are converted to ‘not a number’ (numpy.NaN) values:\n",
    "    \n",
    "import numpy, pywt\n",
    "x = [None, None]\n",
    "mode = 'symmetric'\n",
    "wavelet = 'db1'\n",
    "cA, cD = pywt.dwt(x, wavelet, mode)\n",
    "numpy.all(numpy.isnan(cA))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "ee8b9e95-de47-4bb6-abd6-60ed1d4575a9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "numpy.all(numpy.isnan(cD))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e9a97c4e-896e-496d-9302-105932346f93",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rec = pywt.idwt(cA, cD, wavelet, mode)\n",
    "numpy.all(numpy.isnan(rec))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e948bee1-285f-4cbc-8d0c-ccff76eb7182",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
